<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var row =
    {
      "code": 200,
      "message": "success",
      "data": {
        "KeyField": null,
        "HXUnickID": "f6b70c686b1d4c17a5e370dc80262c13",
        "total": 0,
        "totalPage": 0,
        "pageSize": 0,
        "pageNum": 0,
        "title": [{
          "ColName": "A01_A0101",
          "DisplayLabel": "姓名"
        }, {
          "ColName": "A01_A0188",
          "DisplayLabel": "负责用户"
        }, {
          "ColName": "A01_A0190",
          "DisplayLabel": "人员编号"
        }, {
          "ColName": "A01_DEPT_ID",
          "DisplayLabel": "部门范围"
        }, {
          "ColName": "C048_A0188",
          "DisplayLabel": "人员ID"
        }, {
          "ColName": "C048_RECORDID",
          "DisplayLabel": "记录标识号"
        }, {
          "ColName": "C048_A_ID",
          "DisplayLabel": "序号"
        }, {
          "ColName": "C048_SIGNED",
          "DisplayLabel": "审批标记"
        }, {
          "ColName": "C048_S_DTAE",
          "DisplayLabel": "日期"
        }, {
          "ColName": "C048_KGUID",
          "DisplayLabel": "KGUID"
        }, {
          "ColName": "C048_OPDATE",
          "DisplayLabel": "操作时间"
        }, {
          "ColName": "C048_OPNAME",
          "DisplayLabel": "操作者"
        }],
        "list": [{
          "A01_A0188": 513,
          "A01_A0190": "10513",
          "A01_A0101": "施飞",
          "A01_DEPT_ID": 83,
          "A01_DEPT_ID_MC": "资产管理科",
          "C048_A0188": 513,
          "C048_RECORDID": 791,
          "C048_A_ID": 1,
          "C048_SIGNED": 0,
          "C048_S_DTAE": null,
          "C048_KGUID": "383f7e73-618f-4b23-b570-15522cbec547",
          "C048_OPDATE": "2019-08-15T23:04:00",
          "C048_OPNAME": "刘德华{10001}"
        }, {
          "A01_A0188": 513,
          "A01_A0190": "10513",
          "A01_A0101": "施飞",
          "A01_DEPT_ID": 83,
          "A01_DEPT_ID_MC": "资产管理科",
          "C048_A0188": 513,
          "C048_RECORDID": 792,
          "C048_A_ID": 2,
          "C048_SIGNED": 0,
          "C048_S_DTAE": null,
          "C048_KGUID": "d19e7df1-cf34-4721-9f1d-730c7fc54e7b",
          "C048_OPDATE": "2019-08-15T23:04:00",
          "C048_OPNAME": "刘德华{10001}"
        }, {
          "A01_A0188": 513,
          "A01_A0190": "10513",
          "A01_A0101": "施飞",
          "A01_DEPT_ID": 83,
          "A01_DEPT_ID_MC": "资产管理科",
          "C048_A0188": 513,
          "C048_RECORDID": 793,
          "C048_A_ID": 3,
          "C048_SIGNED": 0,
          "C048_S_DTAE": null,
          "C048_KGUID": "b672e1d9-d0a6-4038-9096-98c0e61869f6",
          "C048_OPDATE": "2019-08-15T23:04:00",
          "C048_OPNAME": "刘德华{10001}"
        }]
      }
    }


    console.log('row', row);

    initData(row.data)
    function initData(data) {
      console.log('data', data);
      var arr = []
      for (var item of data.list) {
        var obj = {}
        for (var colName in item) {
          debugger
          var flag = false;
          console.log('colName', colName);
          for (var title of data.title) {
            debugger
            if (title.ColName === colName) {
              debugger
              var key = colName + '-' + title.DisplayLabel;
              var value = item[colName];
              obj[key] = value;

              flag = true;
              break;
            }
          }

          // if (flag) {
          //   break;
          // }

        }
        arr.push(obj)
      }
      console.log('arr', arr);
    }
  </script>
</body>

</html>